import {
  ref
} from "vue"

// 表单数据
export const mobAndPasList = ref({
  mobile: "",
  code: "",
  password: ""
})

// 校验规则

// 验证码
export const mobAndPasRules = {
  mobile: {
    rules: [{
        required: true,
        errorMessage: '请输入手机号',
      },
      {
        pattern: /^(?:(?:\+|00)86)?1\d{10}$/,
        errorMessage: "请输入符合规则的手机号"
      }
    ],
  },
  code: {
    rules: [{
      required: true,
      errorMessage: '请输入验证码',
    }, {
      minLength: 6,
      maxLength: 6,
      errorMessage: '请输入一个6位数的验证码',
    }, ],
  }

}


// 手机号
export const mobAndPassRules = {
  mobile: {
    rules: [{
        required: true,
        errorMessage: '请输入手机号',
      },
      {
        pattern: /^(?:(?:\+|00)86)?1\d{10}$/,
        errorMessage: "请输入符合规则的手机号"
      }
    ],
  },
  password: {
    rules: [{
      required: true,
      errorMessage: '请输入密码',
    }, {
      minLength: 4,
      maxLength: 8,
      errorMessage: '请输入一个6位数的密码码',
    }, ],
  }

}


// 是否勾选协议
export const isAgreement = ref(false)